package cn.cq.admin.controller;

import cn.cq.annotation.OperationLogAnnotation;
import cn.cq.admin.service.TLoginLogService;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.util.SaResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * cn.cq.admin.controller
 *
 * @author dicraft
 */
@RestController
@RequestMapping("/log")
public class LogController {

    @Resource
    private TLoginLogService loginLogService;

    /**
     * 获取登录日志列表（最近5条）
     * @return
     */
    @OperationLogAnnotation(module = "个人信息",type = "查询",description = "获取登录日志列表（最近5条）")
    @SaCheckLogin
    @GetMapping("/doLoginLog")
    public SaResult doLoginLog(){
        return loginLogService.doLoginLog();
    }
}
